package c.x.jy.dao.dao;

import c.x.jy.dao.dto.OrderEntityDto;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;

import c.x.jy.dao.entity.OrderEntity;

/**
 * 会员订单表
 * 
 * @author amwhyh
 * @email xxx@xx.com
 * @date 2021-05-25 10:49:02
 */
@Mapper
public interface OrderDao extends BaseMapper<OrderEntity> {
    @Select("select * from t_order where order_no= ${orderNo} limit 1")
	OrderEntity selectOrderByNo(String orderNo);
    @Select("select * from t_order  ${ew.customSqlSegment} order by create_date desc")
    IPage<OrderEntityDto> querypage(IPage<OrderEntity> page,@Param(Constants.WRAPPER) QueryWrapper<OrderEntity> query);

    @Select("select * from t_order where id= ${id} for update ")
	OrderEntity selectOrderBYIdForUpdate(Long orderId);
}

